/*
 * GuiManager.cpp
 *
 *  Created on: Aug 25, 2011
 *      Author: PoZ
 */

#include "core/GameEngine.h"
#include "GuiManager.h"

namespace projectcos
{
namespace gui
{
/*
const int GuiManager::NAVMODE_NONAVKEYS = HGEGUI_NONAVKEYS;
const int GuiManager::NAVMODE_LEFTRIGHT = HGEGUI_LEFTRIGHT;
const int GuiManager::NAVMODE_UPDOWN = HGEGUI_UPDOWN;
const int GuiManager::NAVMODE_CYCLED = HGEGUI_CYCLED;
*/

GuiManager::GuiManager(HGE* hge)
{
	this->m_hgeGUI = new hgeGUI();
	this->m_HGE = hge;
	this->m_defaultFont = NULL;
}

GuiManager::~GuiManager()
{
	delete this->m_hgeGUI;

	// Delete old fonts if exist
	if (NULL != this->m_defaultFont)
		delete this->m_defaultFont;
}

void GuiManager::SetFont(std::string fontFile)
{
	// Delete old fonts if exist
	if (NULL != this->m_defaultFont)
		delete this->m_defaultFont;

	this->m_defaultFont = new hgeFont(fontFile.c_str());
}

hgeFont* GuiManager::GetFont()
{
	return this->m_defaultFont;
}

void GuiManager::AddCtrl(hgeGUIObject* ctrl)
{
	this->m_hgeGUI->AddCtrl(ctrl);
}

void GuiManager::DelCtrl(int id)
{
	this->m_hgeGUI->DelCtrl(id);
}

hgeGUIObject* GuiManager::GetCtrl(int id)
{
	return this->m_hgeGUI->GetCtrl(id);
}

void GuiManager::MoveCtrl(int id, float x, float y)
{
	this->m_hgeGUI->MoveCtrl(id, x, y);
}

void GuiManager::ShowCtrl(int id, bool visible)
{
	this->m_hgeGUI->ShowCtrl(id, visible);
}

void GuiManager::EnableCtrl(int id, bool enable)
{
	this->m_hgeGUI->EnableCtrl(id, enable);
}

void GuiManager::SetNavMode(int mode)
{
	this->m_hgeGUI->SetNavMode(mode);
}

void GuiManager::SetCursor(hgeSprite *sprite)
{
	this->m_hgeGUI->SetCursor(sprite);
}

void GuiManager::SetColor(DWORD color)
{
	this->m_hgeGUI->SetColor(color);
}

void GuiManager::SetFocus(int id)
{
	this->m_hgeGUI->SetFocus(id);
}

int GuiManager::GetFocus()
{
	return this->m_hgeGUI->GetFocus();
}

void GuiManager::Render()
{
	this->m_hgeGUI->Render();
}

} // namespace gui
} // namespace projectcos


